The present technique relates to an apparatus and method for controlling branch prediction.
A data processing apparatus may have branch prediction circuitry for predicting outcomes of branch instructions before they are actually executed. By predicting branch outcomes before the branch instruction is actually executed, subsequent instructions following the branch can start to be fetched and speculatively executed before execution of the branch instruction is complete, so that if the prediction is correct then performance is saved because the subsequent instructions can be executed sooner than if they were only fetched once the outcome of the branch is actually known.
In order to obtain optimum performance benefits form the use of branch prediction, it is desirable that the predictions made by the branch prediction circuitry are as accurate as possible, so as to reduce the number of mispredictions that arise when using the branch prediction circuitry.